package cn.lili.controller.wechat;

import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.payment.entity.dos.WithdrawLog;
import cn.lili.modules.payment.entity.dto.WithdrawLogSearchParams;
import cn.lili.modules.payment.service.WithdrawLogService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 提现申请
 *
 * @author Bulbasaur
 */
@Slf4j
@RestController
@Api(tags = "管理端,提现记录接口")
@RequestMapping("/payment/withdrawLog")
public class WithdrawLogController {

    @Autowired
    private WithdrawLogService withdrawLogService;


    @ApiOperation(value = "获取提现记录分页")
    @GetMapping
    public ResultMessage<IPage<WithdrawLog>> getByPage(WithdrawLogSearchParams withdrawLogSearchParams) {
        return ResultUtil.data(withdrawLogService.withdrawLogPage(withdrawLogSearchParams));
    }

    @ApiOperation(value = "通过提现详情")
    @GetMapping(value = "/get/{id}")
    public ResultMessage<WithdrawLog> get(@PathVariable String id) {
        return ResultUtil.data(withdrawLogService.getWithdrawLog(id));
    }


}
